/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package pe.sonrisas.tools.entities;

import java.io.Serializable;
import java.util.Date;
import javax.persistence.*;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author DIEGOALV
 */
@Entity
@Table(name = "odontograma")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Odontograma.findAll", query = "SELECT o FROM Odontograma o"),
    @NamedQuery(name = "Odontograma.findByIdOdontograma", query = "SELECT o FROM Odontograma o WHERE o.idOdontograma = :idOdontograma"),
    @NamedQuery(name = "Odontograma.findByFecha", query = "SELECT o FROM Odontograma o WHERE o.fecha = :fecha"),
    @NamedQuery(name = "Odontograma.findByActivoOdontograma", query = "SELECT o FROM Odontograma o WHERE o.activoOdontograma = :activoOdontograma")})
public class Odontograma implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "idOdontograma")
    private Integer idOdontograma;
    @Column(name = "fecha")
    @Temporal(TemporalType.TIMESTAMP)
    private Date fecha;
    @Basic(optional = false)
    @Column(name = "activoOdontograma")
    private boolean activoOdontograma;
    @JoinColumn(name = "idPaciente", referencedColumnName = "idPaciente")
    @ManyToOne(optional = false)
    private Paciente idPaciente;

    public Odontograma() {
    }

    public Odontograma(Integer idOdontograma) {
        this.idOdontograma = idOdontograma;
    }

    public Odontograma(Integer idOdontograma, boolean activoOdontograma) {
        this.idOdontograma = idOdontograma;
        this.activoOdontograma = activoOdontograma;
    }

    public Integer getIdOdontograma() {
        return idOdontograma;
    }

    public void setIdOdontograma(Integer idOdontograma) {
        this.idOdontograma = idOdontograma;
    }

    public Date getFecha() {
        return fecha;
    }

    public void setFecha(Date fecha) {
        this.fecha = fecha;
    }

    public boolean getActivoOdontograma() {
        return activoOdontograma;
    }

    public void setActivoOdontograma(boolean activoOdontograma) {
        this.activoOdontograma = activoOdontograma;
    }

    public Paciente getIdPaciente() {
        return idPaciente;
    }

    public void setIdPaciente(Paciente idPaciente) {
        this.idPaciente = idPaciente;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idOdontograma != null ? idOdontograma.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Odontograma)) {
            return false;
        }
        Odontograma other = (Odontograma) object;
        if ((this.idOdontograma == null && other.idOdontograma != null) || (this.idOdontograma != null && !this.idOdontograma.equals(other.idOdontograma))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "entities.Odontograma[ idOdontograma=" + idOdontograma + " ]";
    }
    
}
